// 
import {request, uploadFile} from './request'

// 在线预览
export const onlinePreview = (data) => request('/oss/file-anon/online/preview',{
	method: 'post',
	header: { plat: 4 },
	loadingText: '生成中',
	data
})
// app首页banner-list查询 
export const getAppBanner = (data) => request('/sys/app/banner',{
	method: 'get',
	header: { plat: 4 },
	data
})
// 判断小程序是否绑定手机号
export const getAppletBinding = (data) => request('/oauth/applet/binding',{
	method: 'get',
    header: { 'Content-Type': 'application/x-www-form-urlencoded' },
	data
})
// 小程序登录
export const appletLogin = (data) => request('/oauth/applet/login',{
	method: 'post',
	data
})

// 名片分享微信appId相关数据层 
export const getWxConfig = (data) => request('/member/share/member/weXinAppId',{
	method: 'get',
	data
})


// 获取版本号
export const getAndroidVersion = (data) => request('/sys/app/version/checkUpdate/2')
// 上传文件
export const fileUploadAnon = (data) => {
  // const formData = new FormData()
  // formData.append('file', data)
  return uploadFile('/oss/file-anon/upload',
  {
    headers: { 'Content-Type': 'multipart/form-data' },
    method: 'post',
	name: 'file',
    filePath: data.path
  })
}
// 上传文件 --视频 
export const fileVideoUploadAnon = (data) => {
  // const formData = new FormData()
  // formData.append('file', data)
  return uploadFile('/oss/file-anon/upload/album',
  {
    headers: { 'Content-Type': 'multipart/form-data' },
    method: 'post',
	name: 'file',
    filePath: data.path
  })
}
export const fileAnonoUploadMpc = (data) => {
  // const formData = new FormData()
  // formData.append('file', data)
  return uploadFile('/oss/file-anon/upload/mpc',
  {
    headers: { 'Content-Type': 'multipart/form-data' },
    method: 'post',
	name: 'file',
    filePath: data.path
  })
}

// 发送短信验证码
export const notifySms = (data) => request('/notify/sms',{
	method: 'get',
	data
})
// // 发送短信验证码
// export const notifySms = (mobile) => request('/notify/sms',{
// 	method: 'get',
// 	data:{
// 		type: 'LOGIN',
// 		mobile: mobile
// 	}
// })
// 短信登录 H5
export const oauthSms = (data) => request('/oauth/token/h5/sms',{
	method: 'post',
    headers: {
		client_id: 'backed',
		client_secret: '123456'
	},
	data
})
// 短信登录 微信
export const oauthSmsWechat = (data) => request('/oauth/applet/sms',{
	method: 'post',
	data
})
// 将base64转成URL
export const Base64toUrl = (data) => request('/oss/file-anon/toUrl',{
	method: 'post',
	data
})

// 地区下拉框
export const areaSelect = (data) => request('/sys/area/box',{
	method: 'get',
	data
})

export const getCardDetails = (data) => request('/member/card/info',{  data })

export const agreementPrivacy = (data)=>request('/sys/share/agreement/privacy')
export const agreementUser = () => request('/sys/share/agreement/user')

// 搜索
export const searchContacts = (data) => request('/member/contacts/unless/search',{  data })
export const searchDynamic = (data) => request('/circle/circle-dynamic/search/list',{  data })
export const searchCompany = (data) => request('/search/complex/company',{  data })
export const searchProduct = (data) => request('/sys/product',{  data })
export const recordOpenApp = (data) => request('/member/register/recordClickLog',{ method: 'post', data })
// MPC—抽帧截图
export const ossMpc = (data) => request('/oss/file-anon/mpc',{ method: 'get', data})
// 名片首页 - 城市速写
export const homeCity = (data) => request('/member/card/home/city',{ method: 'get', header: { plat: 4 }, data})
// 查询app相关配置修改版本log
export const moduleVersion = () => request('/sys/share/moduleVersion',{ method: 'get', header: { plat: 4 }})

